home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / alotof1a / stuff.bas
BASIC Source File  |  1999-09-11  |  26KB  |  757 lines

  1. Attribute VB_Name = "KiKz_Bas"
  2. Option Explicit
  3. '       wasup?
  4. 'i know a few subs on this bas dont quite work
  5. 'but dont complain...cause if u complain about my work u can go on ahead and write your OWN code
  6. 'remember, this is the first beta release of my bas
  7. '
  8. 'all code in this bas was written by ME unless stated otherwise
  9. '
  10. 'and all code in this bas is Legally Copyrighted to ME not U
  11. 'in otherwords...
  12. '
  13. 'WRITE YOUR OWN MOTHERFUCKING CODE!
  14. 'BITCH
  15. '
  16. 'Greetz-
  17. '
  18. 'Kaos
  19. 'chad
  20. 'lax
  21. 'haaj
  22. 'KnK
  23. 'solja
  24. 'har0
  25. 'crzy
  26. 'kuso
  27. '
  28. 'lata
  29. '   -kik
  30. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  31. Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
  32. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  33. Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
  34. Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
  35. Public Declare Function ReleaseCapture Lib "user32" () As Long
  36. Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  37. Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
  38. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  39. Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  40. Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
  41. Public Declare Function CharUpper Lib "user32" Alias "CharUpperA" (ByVal lpsz As String) As String
  42. Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  43. Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
  44. Public Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
  45. Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
  46. Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
  47. Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
  48.  
  49.  
  50. Public Const SWP_NOSIZE = &H1
  51. Public Const SWP_NOMOVE = &H2
  52. Public Const WM_GETTEXT = &HD
  53. Private Const SPI_SCREENSAVERRUNNING = 97
  54. Public Const WM_GETTEXTLENGTH = &HE
  55. Public Const WM_LBUTTONDOWN = &H201
  56. Public Const WM_LBUTTONUP = &H202
  57. Public Const WM_SETTEXT = &HC
  58. Public Const WM_KEYDOWN = &H100
  59. Public Const WM_KEYUP = &H101
  60. Public Const WM_ENABLE = &HA
  61. Public Const HWND_NOTOPMOST = -2
  62. Public Const HWND_TOPMOST = -1
  63. Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  64. Public Const WM_MOVE = &H3
  65. Public Const WM_SYSCOMMAND = &H112
  66. Public Const HIDE_WINDOW = 0
  67. Public Const BM_GETCHECK = &HF0
  68. Public Const BM_SETCHECK = &HF1
  69.  
  70. Public Const LB_GETCOUNT = &H18B
  71. Public Const LB_GETITEMDATA = &H199
  72. Public Const LB_GETTEXT = &H189
  73. Public Const LB_GETTEXTLEN = &H18A
  74. Public Const LB_SETCURSEL = &H186
  75. Public Const LB_SETSEL = &H185
  76. Public Const LB_SELECTSTRING = &H18C
  77.  
  78. Public Const SND_ASYNC = &H1
  79. Public Const SND_NODEFAULT = &H2
  80. Public Const SND_FLAG = SND_ASYNC Or SND_NODEFAULT
  81.  
  82. Public Const SW_HIDE = 0
  83. Public Const SW_SHOW = 5
  84.  
  85. Public Const VK_DOWN = &H28
  86. Public Const VK_LEFT = &H25
  87. Public Const VK_MENU = &H12
  88. Public Const VK_RETURN = &HD
  89. Public Const VK_RIGHT = &H27
  90. Public Const VK_SHIFT = &H10
  91. Public Const VK_UP = &H26
  92.  
  93. Public Const WM_CHAR = &H102
  94. Public Const WM_CLOSE = &H10
  95. Public Const WM_COMMAND = &H111
  96. Public Const WM_LBUTTONDBLCLK = &H203
  97. Public Const VK_SPACE = &H20
  98.  
  99.  
  100. Public Const PROCESS_READ = &H10
  101. Public Const RIGHTS_REQUIRED = &HF0000
  102.  
  103. Function BLWindow() As Long
  104. 'this could help u if u r writing your own bas...
  105. 'i dont care if u take this code
  106. 'it just finds the bl window
  107. Dim Window As Long
  108. Window& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  109. BLWindow& = Window&
  110. End Function
  111.  
  112. Function IM_Sn() As String
  113. 'gets the screenname of the person u r talking to
  114.     Dim IMWin As Long, GetIt As String, Clear As String
  115.  
  116.     IMWin& = FindWindow("AIM_IMessage", vbNullString)
  117.     GetIt$ = Get_Caption(IMWin&)
  118.     Clear$ = ReplaceString(GetIt$, " - Instant Message", "")
  119.     IM_Sn = Clear$
  120. End Function
  121.  
  122. Function Dis_Ctrl_Alt_Del()
  123. 'this disables Ctrl+Alt+Delete
  124. 'make sure u enable it before your prog. ends
  125. Dim ret As Integer
  126. Dim pOld As Boolean
  127.      ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  128. End Function
  129. Function En_Ctrl_Alt_del()
  130. 'this enables Ctrl+Alt+Delete
  131. Dim ret As Integer
  132. Dim pOld As Boolean
  133.      ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  134. End Function
  135.  
  136. Function Aim_Flash()
  137. 'this will drive sombody crazy...
  138. 'make a timer set the interval to whatever u want
  139. 'in it put Aim_Flash
  140. 'to stop it just disable the timer AND use...
  141. 'Aim_StopFlash
  142. Dim BL As Long
  143. BL& = BLWindow
  144. Call FlashWindow(BL&, True)
  145. End Function
  146.  
  147. Function Aim_StopFlash()
  148. 'stops Aim_Flash
  149. Dim BL As Long
  150. BL& = BLWindow
  151. Call FlashWindow(BL&, False)
  152. End Function
  153.  
  154. Function Flash_Form(Frm As Form)
  155. 'this will drive sombody crazy...
  156. 'make a timer set the interval to whatever u want
  157. 'in it put Flash_Form Me
  158. 'to stop it just disable the timer AND use...
  159. 'Flash_Stop
  160.     Call FlashWindow(Frm.hwnd, True)
  161. End Function
  162.  
  163. Function Flash_Stop(Frm As Form)
  164. 'stops Flash_Form
  165. Call FlashWindow(Frm.hwnd, False)
  166. End Function
  167.  
  168. Function Set_AimCaption(NwCaption As String)
  169. 'sets the caption of your BL window
  170. 'i dont reccomend u do this
  171. 'cause the get SN wont work
  172. Dim BL As Long
  173. BL& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  174. Call SetWindowText(BL&, NwCaption$)
  175. End Function
  176.  
  177. Public Function Aim_LastLine() As String
  178. 'my pride and joy...i wrote ALL this code it was not stolen
  179.     On Error GoTo ErrHandler
  180.  
  181.     Dim ChatText As String
  182.     ChatText$ = Aim_GetChatText
  183.     If Len(ChatText$) > 500 Then
  184.         ChatText$ = Right$(ChatText$, 250)
  185.     End If
  186.     If InStr(ChatText$, ")--></B></FONT><FONT COLOR=""#") <> 0 Then
  187.         ChatText$ = Mid$(ChatText$, LastInStr(ChatText$, ")--></B></FONT><FONT COLOR=""#") + 38)
  188.         ChatText$ = RemoveHTML(ChatText$)
  189.         ChatText$ = Trim$(ChatText$)
  190.         Aim_LastLine = Keep(ChatText$, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890)(*&^%$#@!~`"";:'?/\.,][}{+=_-|╗ ")
  191.     Else
  192.         Aim_LastLine = ""
  193.     End If
  194.     Exit Function
  195.     
  196. ErrHandler:
  197.     Aim_LastLine = ""
  198.  
  199. End Function
  200.  
  201. Function Aim_CloseChat()
  202. 'closes the chat window
  203. Dim ChtWnd As Long
  204. ChtWnd& = FindWindow("AIM_ChatWnd", vbNullString)
  205. Call SendMessage(ChtWnd&, WM_CLOSE, 0&, 0&)
  206. End Function
  207.  
  208. Function Aim_CloseIM()
  209. 'closes the IM window
  210. Dim IMWnd As Long
  211. IMWnd& = FindWindow("AIM_IMessage", vbNullString)
  212. Call SendMessage(IMWnd&, WM_CLOSE, 0&, 0&)
  213. End Function
  214.  
  215. Function Aim_SignOff()
  216. 'Sign off aim
  217. Dim BLWnd As Long
  218. BLWnd& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  219. Call SendMessage(BLWnd&, WM_CLOSE, 0&, 0&)
  220. End Function
  221.  
  222. Function Chat_RoomName()
  223. 'gets the chat room name
  224.     Dim ChatWin As Long, GetIt As String, Clear As String
  225.  
  226.     ChatWin& = FindWindow("AIM_ChatWnd", vbNullString)
  227.     GetIt$ = Get_Caption(ChatWin&)
  228.     Cl